package com.microservice.microservicemovie.controller;

import com.microservice.microservicemovie.client.feign.UserClient;
import com.microservice.microservicemovie.entity.User;
import com.netflix.appinfo.InstanceInfo;
import com.netflix.discovery.EurekaClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

/**
 * 〈一句话功能简述〉
 * 〈功能详细描述〉
 *
 * @author bf
 * @create 2017/11/7
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */

@RestController
@RequestMapping
public class MovieController {

    @Autowired
    private UserClient userClient;


    @GetMapping("/user/{id}")
    public User getUser(@PathVariable Long id){
        return userClient.getUser(id);
    }

    @PostMapping("/postuser")
    public User postUser(@RequestBody User user){
        return userClient.postUser(user);
    }

    @GetMapping("/get-user")
    public User getTest(User user){
        return userClient.getTest(user);
    }



}
